#ifndef SCENE_NODE_H
#define SCENE_NODE_H

#include "ISceneNode.h"
#include "mathlib.h"
#include <vector>
#include <string>

typedef std::vector<ISceneNode*> SceneNodeList;

class SceneNode : public ISceneNode
{
public:

	SceneNode(std::string name, const Matrix4 *to, const Matrix4 *from = NULL)
	{
		m_name = name;
		SetTransform(to, from);
	}

	virtual ~SceneNode();

	virtual void SetTransform(const Matrix4 *toWorld, const Matrix4 *fromWorld = NULL);

	virtual void Update(float gameSpeed);

	virtual void Draw();

	virtual void DrawChildren();

	virtual bool AddChild(ISceneNode* child);

	Vector3 GetPosition() const { return m_toWorld.GetPosition(); }
	void SetPosition(const Vector3& pos) { m_toWorld.SetPosition(pos); }


protected:

	SceneNodeList m_children;
	SceneNode *m_parent;

	std::string m_name;
};

#endif